<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.listForm.yiLiaoJiGouxinxi"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
    <link href="${ctx}/lib/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" />
    <style type="text/css">
    	span.required {
    		color: red;
    		margin-right: 6px;
    	}
    	.box-body{
    	margin-top:7px;
    	}
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.listForm.yiLiaoJiGouxinxi"/></h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.title.xiTongSheZhi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.jiGouXinXi"/></a></li>
        </ol>
    </section>
    <section class="content">
      <form id="form" class="form-horizontal" action="saveHospOrgInfo.html" method="post">    
        <div class=" box box-success ">
           
            	<input type="hidden" name="hospId" value="${hospInfo.hospId}" />
            	
                <div class="box-body">
                    <div class="form-group form-group-xs">
                        <label for="hospCode" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGouBianMa"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospCode" value="${ hospInfo.hospCode }" type="text" readonly="readonly">
                        </div>
                        <label for="hospName" class="col-sm-3 text-right"><spring:message code="message.listForm.yiLiaoJiGouMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospName" value="${ hospInfo.hospName }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="hospShortName" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGouJianCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospShortName" value="${ hospInfo.hospShortName }" type="text" readonly="readonly">
                        </div>
                        <label for="orgCode" class="col-sm-3 text-right"><spring:message code="message.listForm.zuZhiJiGouDaiMa"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="orgCode" value="${ hospInfo.orgCode }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="hospClassify" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGouFenLei"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                        	<input class="form-control" id="hospClassify" value="${ hospInfo.hospClassifyName }" type="text" readonly="readonly">
                        </div>
                        <label for="hospType" class="col-sm-3 text-right"><spring:message code="message.listForm.yiLiaoJiGouLeiXing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                        	<input class="form-control" id="hospType" value="${ hospInfo.hosptype.hospType }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="hospLevelId" class="col-sm-2 text-right"><spring:message code="message.listForm.yiLiaoJiGouDengJi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                        	<input class="form-control" id="hospLevelId" value="${ hospInfo.hospLevelName }" type="text" readonly="readonly">
                        </div>
                        <label for="hospPhone" class="col-sm-3 text-right"><spring:message code="message.listForm.yiLiaoJiGouDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospPhone" value="${ hospInfo.hospPhone }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="bedNum" class="col-sm-2 text-right"><spring:message code="message.listForm.chuangWeiShu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="bedNum" value="${ hospInfo.hospInfoDetail.bedNum }" type="text" readonly="readonly">
                        </div>
                        <label for="incomPatNum" class="col-sm-3 text-right"><spring:message code="message.listForm.nianMenZhengLiangDanWei"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="incomPatNum" value="${ hospInfo.hospInfoDetail.incomPatNum }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="staffNum" class="col-sm-2 text-right"><spring:message code="message.listForm.yuanGongShu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="staffNum" value="${ hospInfo.hospInfoDetail.staffNum }" type="text" readonly="readonly">
                        </div>
                        <label for="regCap" class="col-sm-3 text-right"><span class="required">*</span><spring:message code="message.listForm.zhuCheZiBenDanWei"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="regCap" value="${ hospInfo.hospInfoDetail.regCap }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="legalRepName" class="col-sm-2 text-right"><spring:message code="message.listForm.faRenXingMing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="legalRepName" value="${ hospInfo.hospInfoDetail.legalRepName }" type="text" readonly="readonly">
                        </div>
                        <label for="legalRepIdnum" class="col-sm-3 text-right"><spring:message code="message.listForm.faRenShengFenZheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="legalRepIdnum" value="${ hospInfo.hospInfoDetail.legalRepIdnum }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="legalRepTelephone" class="col-sm-2 text-right"><spring:message code="message.listForm.faRenDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="legalRepTelephone" value="${ hospInfo.hospInfoDetail.legalRepTelephone }" type="text" readonly="readonly">
                        </div>
                        <label for="legalRepHandphone" class="col-sm-3 text-right"><spring:message code="message.listForm.faRenShouJi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="legalRepHandphone" value="${ hospInfo.hospInfoDetail.legalRepHandphone }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="contactName" class="col-sm-2 text-right"><span class="required">*</span><spring:message code="message.listForm.liangXiRenXingMing"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactName" name="hospInfoDetail.contactName" value="${ hospInfo.hospInfoDetail.contactName }" placeholder="<spring:message code="message.listForm.liangXiRenXingMing"/>" type="text" maxlength="10">
                        </div>
                        <label for="contactIdnum" class="col-sm-3 text-right"><span class="required">*</span><spring:message code="message.listForm.liangXiRenShengFenZheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactIdnum" name="hospInfoDetail.contactIdnum" value="${ hospInfo.hospInfoDetail.contactIdnum }" placeholder="<spring:message code="message.listForm.liangXiRenShengFenZheng"/>" type="text" maxlength="20">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="contactPos" class="col-sm-2 text-right"><span class="required">*</span><spring:message code="message.listForm.liangXiRenZhiWu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactPos" name="hospInfoDetail.contactPos" value="${ hospInfo.hospInfoDetail.contactPos }" placeholder="<spring:message code="message.listForm.liangXiRenZhiWu"/>" type="text" maxlength="32">
                        </div>
                        <label for="contactTelephone" class="col-sm-3 text-right"><span class="required">*</span><spring:message code="message.listForm.liangXiRenDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactTelephone" name="hospInfoDetail.contactTelephone" value="${ hospInfo.hospInfoDetail.contactTelephone }" placeholder="<spring:message code="message.listForm.liangXiRenDianHua"/>" type="text" maxlength="20">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="contactHandphone" class="col-sm-2 text-right"><span class="required">*</span><spring:message code="message.listForm.liangXiRenShouJi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactHandphone" name="hospInfoDetail.contactHandphone" value="${ hospInfo.hospInfoDetail.contactHandphone }" placeholder="<spring:message code="message.listForm.liangXiRenShouJi"/>" type="text" maxlength="20">
                        </div>
                        <label for="contactEmail" class="col-sm-3 text-right"><span class="required">*</span><spring:message code="message.listForm.liangXiRenYouXiang"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactEmail" name="hospInfoDetail.contactEmail" value="${ hospInfo.hospInfoDetail.contactEmail }" placeholder="<spring:message code="message.listForm.liangXiRenYouXiang"/>" type="text" maxlength="20">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="contactQQ" class="col-sm-2 text-right"><span class="required">*</span><spring:message code="message.listForm.liangXiRenQQ"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="contactQQ" name="hospInfoDetail.contactQQ" value="${ hospInfo.hospInfoDetail.contactQQ }" placeholder="<spring:message code="message.listForm.liangXiRenQQ"/>" type="text" maxlength="20">
                        </div>
                        <label for="hospLiceNo" class="col-sm-3 text-right"><spring:message code="message.listForm.yiLiaoJiGouZhiYeXuKeZhengHao"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospLiceNo" value="${ hospInfo.hospInfoDetail.hospLiceNo }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="hospLiceStartDate" class="col-sm-2 text-right"><spring:message code="message.listForm.ZhiYeXuKeZhengStart"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospLiceStartDate" value="${ hospInfo.hospInfoDetail.hospLiceStartDateStr }" type="text" readonly="readonly">
                        </div>
                        <label for="hospLiceEndDate" class="col-sm-3 text-right"><spring:message code="message.listForm.ZhiYeXuKeZhengEnd"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="hospLiceEndDate" value="${ hospInfo.hospInfoDetail.hospLiceEndDateStr }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="enterLiceNo" class="col-sm-2 text-right"><spring:message code="message.listForm.shiYeDanWeiFaRenZhengShuHao"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="enterLiceNo" value="${ hospInfo.hospInfoDetail.enterLiceNo }" type="text" readonly="readonly">
                        </div>
                        <label for="area" class="col-sm-3 control-label"><spring:message code="message.listForm.diQu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3">
                        	<input class="form-control" id="area" value="${ hospInfo.area.arfullname }" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="enterLiceStartDate" class="col-sm-2 text-right"><spring:message code="message.listForm.shiYeDanWeiFaRenZhengShuStart"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="enterLiceStartDate" value="${ hospInfo.hospInfoDetail.enterLiceStartDateStr }" placeholder="<spring:message code="message.listForm.shiYeDanWeiFaRenZhengShuStart"/>" type="text" readonly="readonly">
                        </div>
                        <label for="enterLiceEndDate" class="col-sm-3 text-right"><spring:message code="message.listForm.shiYeDanWeiFaRenZhengShuEnd"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-3 text-left">
                            <input class="form-control" id="enterLiceEndDate" value="${ hospInfo.hospInfoDetail.enterLiceEndDateStr }" placeholder="<spring:message code="message.listForm.shiYeDanWeiFaRenZhengShuEnd"/>" type="text" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="hospAddress" class="col-sm-2 control-label"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.diZhi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-9">
                            <textarea class="form-control" id="hospAddress" rows="3" readonly="readonly">${ hospInfo.hospAddress }</textarea>
                        </div>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="profile" class="col-sm-2 control-label"><spring:message code="message.listForm.jianJie"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-9">
                            <textarea class="form-control" id="profile" name="profile" rows="3" readonly="readonly">${ hospInfo.hospInfoDetail.profile }</textarea>
                        </div>
                    </div>
                </div>
                
                <div class="box-footer text-center">
                    <button type="button" class="btn btn-primary btn-sm" onclick="submitSave();"><spring:message code="message.button.saveSpacing"/></button>
                </div>
            
        </div>
       </form> 
    </section>
    
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script src="${ctx}/lib/plugins/daterangepicker/moment.js"></script>
    <script src="${ctx}/lib/plugins/daterangepicker/daterangepicker.js"></script>
    
    <script type="text/javascript">
    	//	提交保存
    	function submitSave() {
    		if (validate()) {
	   			$("#form").ajaxSubmit({
	       			dataType : "json",
	       			timeout: 10000,
	       			success : function(result, statusText) {
	       				if (result.success) {
	       					$.HN.message.alert("<spring:message code="message.HN.alert.baoCunCheng"/>", "", "success");
	       				} else {
	       					$.HN.message.alert(result.msg || "", "", "error");
	       				}
	       			}
	       		});
    		}
    	}
    	
    	//	校验角色信息
    	function validate() {
    		var contactName = $.trim($("#contactName").val());
    		if (contactName == null || contactName == "") {
    			$.HN.message.alert("<spring:message code="message.yanZheng.qingShuRu"/><spring:message code="message.listForm.liangXiRenXingMing"/><spring:message code="message.yanZheng.ganTanHao"/>", "", "warn");
    			return false;
    		}
    		$("#contactName").val(contactName);

    		var contactIdnum = $.trim($("#contactIdnum").val());
    		if (contactIdnum == null || contactIdnum == "") {
    			$.HN.message.alert("<spring:message code="message.yanZheng.qingShuRu"/><spring:message code="message.listForm.liangXiRenShengFenZheng"/><spring:message code="message.yanZheng.ganTanHao"/>", "", "warn");
    			return false;
    		} else if (!/^\d+[a-zA-Z0-9]$/.test(contactIdnum)) {
    			$.HN.message.alert("<spring:message code="message.listForm.liangXiRenShengFenZheng"/><spring:message code="message.lable.shenFenZhengGeShi"/>", "", "warn");
    			return false;
    		}
    		$("#contactIdnum").val(contactIdnum);

    		var contactPos = $.trim($("#contactPos").val());
    		if (contactPos == null || contactPos == "") {
    			$.HN.message.alert("<spring:message code="message.yanZheng.qingShuRu"/><spring:message code="message.listForm.liangXiRenZhiWu"/><spring:message code="message.yanZheng.ganTanHao"/>", "", "warn");
    			return false;
    		}
    		$("#contactPos").val(contactPos);

    		var contactTelephone = $.trim($("#contactTelephone").val());
    		if (contactTelephone == null || contactTelephone == "") {
    			$.HN.message.alert("<spring:message code="message.yanZheng.qingShuRu"/><spring:message code="message.listForm.liangXiRenDianHua"/><spring:message code="message.yanZheng.ganTanHao"/>", "", "warn");
    			return false;
    		} else if (!/^(\d+[-]\d+)|(\d+)$/.test(contactTelephone)) {
    			$.HN.message.alert("<spring:message code="message.lable.telephoneFormatError"/>", "", "warn");
    			return false;
    		}
    		$("#contactTelephone").val(contactTelephone);

    		var contactHandphone = $.trim($("#contactHandphone").val());
    		if (contactHandphone == null || contactHandphone == "") {
    			$.HN.message.alert("<spring:message code="message.yanZheng.qingShuRu"/><spring:message code="message.listForm.liangXiRenShouJi"/><spring:message code="message.yanZheng.ganTanHao"/>", "", "warn");
    			return false;
    		} else if (!/^(\d+[-]\d+)|(\d+)$/.test(contactHandphone)) {
    			$.HN.message.alert("<spring:message code="message.lable.mobilephoneFormatError"/>", "", "warn");
    			return false;
    		}
    		$("#contactHandphone").val(contactHandphone);

    		var contactEmail = $.trim($("#contactEmail").val());
    		if (contactEmail == null || contactEmail == "") {
    			$.HN.message.alert("<spring:message code="message.yanZheng.qingShuRu"/><spring:message code="message.listForm.liangXiRenYouXiang"/><spring:message code="message.yanZheng.ganTanHao"/>", "", "warn");
    			return false;
    		} else if (!/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(contactEmail)) {
    			$.HN.message.alert("<spring:message code="message.lable.dianZiYouXiangError"/>", "", "warn");
    			return false;
    		}
    		$("#contactEmail").val(contactEmail);
    		
    		var contactQQ = $.trim($("#contactQQ").val());
            if (contactQQ == null || contactQQ == "") {
                $.HN.message.alert("<spring:message code="message.yanZheng.qingShuRu"/><spring:message code="message.listForm.liangXiRenQQ"/><spring:message code="message.yanZheng.ganTanHao"/>", "", "warn");
                return false;
            } else if (!/\d+$/.test(contactQQ)) {
                $.HN.message.alert("<spring:message code="message.listForm.liangXiRenQQ"/><spring:message code="message.lable.daYuLingDeShu"/>", "", "warn");
                return false;
            }
            $("#contactQQ").val(contactQQ);

    		return true;
    	}
    
    	$(document).ready(function() {
    		
    		
    		
    	});
    </script>
    
</body>
</html>
